home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / TCTOK / OEMSETUP.INF < prev    next >
INI File  |  1996-07-31  |  58KB  |  1,300 lines

  1. ; ------------------------------------------------------------------------
  2. ; Microsoft Windows NT and Driver Installation
  3. ; Thomas-Conrad Token Ring Drivers
  4. ; Copyright 1993,94 Thomas-Conrad Corporation
  5. ; v1.00 (940322)
  6. ; ------------------------------------------------------------------------
  7. ; NOTES: To adapt this OEMSETNT.INF file for another flavor of adapter,
  8. ;        look for the 'NOTE: Adapter Adaptation area' comments.
  9. ;        The model for this installation calls for one .DLL,
  10. ;        one driver .SYS file, and one installation .INF file.  All are
  11. ;        copied during installation and deleted during removal.
  12. ;        To emit debug statements to the debugger, remove the comments 
  13. ;        in the first two statements in [InstallOption].  For documentation
  14. ;        on this script language, dialogs, whys, wherefores, and weirdies, 
  15. ;        look to  the 'NT Programmers Guide', chapters 2 and 4, 'ncpainf.doc' 
  16. ;        from the build 506 NT DDK, and 'setupddk.doc' from  the build 
  17. ;        506 NT DDK (neither made the release DDK for some reason).  
  18. ;        The only script language operator we use that's not documented 
  19. ;        anywhere is the 'tilde' (~), which returns  finds the index of 
  20. ;        a match within a list.
  21. ; ------------------------------------------------------------------------
  22.  
  23. [Source Media Descriptions]
  24.    1  = "Thomas-Conrad Token Ring Drivers Diskette"
  25.  
  26. [Signature]
  27.     FileType = MICROSOFT_DRVLIB_FILE
  28. [GetSignature]
  29.     read-syms Signature
  30.     return $(FileType)
  31.  
  32. [Files-Driver]
  33.    1, tctoknt.sys,  SIZE=51712
  34.    1, eaglecaf.bin, SIZE=26880
  35.  
  36. [Files-Dll]
  37.    1, tctoknt.dll,  SIZE=9216
  38.  
  39. [OptListENG]
  40. ; -----------------------------------------------------------------------------
  41. ; This list supports multiple adapters of a similar type.
  42. ; Format is:  tag = option, irqs, selection , name, title, description
  43. ; tag          - tag required by script file, it's ignored for all intents...
  44. ; option       - an NCPA variable used to drive option selection
  45. ; selection    - displayed in 'Add Network Adapter' dialog box
  46. ; name         - base name for adapter in the registry
  47. ; title        - 'Installed Adapter Cards' item in the NCPA Network dialog box
  48. ; description  - 'Description' item in the NCPA Network dialog box
  49. ; -----------------------------------------------------------------------------
  50. ;  tag    = option,   selection,               name,     title,                       description
  51. ;
  52. OptList_2 = tc$4045e, "Thomas-Conrad TC4045 Token Ring Adapter",  "TCTOK",  "TC4045 Token Ring Adapter", "Thomas-Conrad 16/4Mbps Token Ring Adapter/AT"
  53. OptList_3 = tc$4046e, "Thomas-Conrad TC4046 Token Ring Adapter",  "TCTOK",  "TC4046 Token Ring Adapter", "Thomas-Conrad 16/4Mbps Token Ring Adapter/MC"
  54.                           
  55. [FileConstants]
  56.    ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  57.    ; NOTE: Adapter Adaptation area
  58.    ; TccBaseName - base filename for .sys, .dll files, binding rules
  59.    ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  60.    Manufacturer             = "Thomas-Conrad"
  61.    TccBaseName              = "tctok"
  62.    SoftwareMajorVersion     = "1"
  63.    SoftwareMinorVersion     = "00s1"
  64.    InterruptTextList        = ^(InterruptChoices, 1)
  65.    InterruptValueList       = ^(InterruptChoices, 2)
  66.    IoBaseTextList           = ^(IoBaseChoices, 1)
  67.    IoBaseValueList          = ^(IoBaseChoices, 2)
  68.    DmaChannelTextList       = ^(DmaChannelChoices, 1)
  69.    DmaChannelValueList      = ^(DmaChannelChoices, 2)
  70.    SpeedTextList            = ^(SpeedChoices, 1)
  71.    SpeedValueList           = ^(SpeedChoices, 2)
  72.    SpeedRadioButtonIdxList  = ^(SpeedChoices, 3)
  73.    SlotNumberTextList       = ^(SlotNumberChoices, 1)
  74.    SlotNumberValueList      = ^(SlotNumberChoices, 2)
  75.    ; - - - - - - - - - - - - - - -
  76.    NetEventDLL              = "%SystemRoot%\System32\netevent.dll"
  77.    IoLogMsgDLL              = "%SystemRoot%\System32\IoLogMsg.dll"
  78.    UtilityInf               = "UTILITY.INF"
  79.    SubroutineInf            = "SUBROUTN.INF"
  80.    SoftwareType             = "driver"
  81.    Exit_Code                = 0
  82.    SoftwareVersion          = $(SoftwareMajorVersion)"."$(SoftwareMinorVersion)
  83.    SoftwareImage            = "\SystemRoot\System32\drivers\"$(TccBaseName)"nt.sys"
  84.    NetRuleSoftwareType      = $(TccBaseName)"Sys ndisDriver "$(TccBaseName)"Driver"
  85.    NetRuleSoftwareBindForm  = """"$(TccBaseName)"Sys"" yes no container"
  86.    NetRuleSoftwareBindable  = {""$(TccBaseName)"Driver "$(TccBaseName)"Adapter non exclusive 100"}
  87.    NetRuleSoftwareClass     = {""$(TccBaseName)"Driver basic"}
  88.    NetRuleSoftwareUse       = $(SoftwareType)
  89.    NetRuleHardwareType      = $(TccBaseName)" "$(TccBaseName)"Adapter"
  90.    NetRuleHardwareClass     = {""$(TccBaseName)"Adapter basic"}
  91.    NetRuleHardwareBindForm  = " yes yes container"
  92.    KeyName_SoftwareRoot     = $(!NTN_SoftwareBase)"\"$(Manufacturer)
  93.    KeyName_Software         = $(KeyName_SoftwareRoot)"\"$(TccBaseName)"\CurrentVersion"
  94.  
  95. [InterruptChoices]
  96.    Interrupt_1  = "2/9",  2
  97.    Interrupt_2  = "3"  ,  3
  98.    Interrupt_4  = "5"  ,  5
  99.    Interrupt_4  = "6"  ,  6
  100.    Interrupt_5  = "7"  ,  7
  101.    Interrupt_6  = "10" , 10
  102.    Interrupt_7  = "11" , 11
  103.    Interrupt_8  = "12" , 12
  104.                      
  105. [IoBaseChoices]  
  106.    IoBaseChoice_1 = "1A20", 6688
  107.    IoBaseChoice_2 = "2A20", 10784
  108.    IoBaseChoice_3 = "3A20", 14880
  109.    IoBaseChoice_4 = "3A40", 14912
  110.    IoBaseChoice_5 = "3A60", 14944
  111.    IoBaseChoice_6 = "3A80", 14976
  112.    IoBaseChoice_7 = "3AA0", 15008
  113.    IoBaseChoice_8 = "4AE0", 19168
  114.  
  115. [DmaChannelChoices]
  116.    DmaChannelChoice_1 = "5",        5
  117.    DmaChannelChoice_2 = "6",        6
  118.    DmaChannelChoice_3 = "7",        7
  119.    DmaChannelChoice_4 = "1",        1
  120.    DmaChannelChoice_5 = "Disabled", 0
  121.  
  122. [SpeedChoices]
  123.    SpeedChoice_1 = "4 Mbps",   4, 1
  124.    SpeedChoice_2 = "16 Mbps", 16, 2
  125.  
  126. [SlotNumberChoices]
  127.    SlotNumberChoice_1 = "Slot 1", 1
  128.    SlotNumberChoice_2 = "Slot 2", 2
  129.    SlotNumberChoice_3 = "Slot 3", 3
  130.    SlotNumberChoice_4 = "Slot 4", 4
  131.    SlotNumberChoice_5 = "Slot 5", 5
  132.    SlotNumberChoice_6 = "Slot 6", 6
  133.    SlotNumberChoice_7 = "Slot 7", 7
  134.    SlotNumberChoice_8 = "Slot 8", 8
  135.  
  136. [FileConstantsENG]
  137.    ProCaption              = "Windows NT Setup"
  138.    ProCancel               = "Cancel"
  139.    ProCancelMsg            = "Your Thomas-Conrad Windows NT Networking "+
  140.                              "Adapter is not correctly installed.  Are "+
  141.                              "you sure you want to cancel copying files?"
  142.    ProCancelCap            = "Network Setup Message"
  143.    ProText1                = "Copying:"
  144.    ProText2                = "To:"
  145.    ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  146.    ; NOTE: Adapter Adaptation area
  147.    ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  148.    ; SoftwareTitle        - Short name, displayed in NCPA dlg box in 
  149.    ;                        'Installed Network Software' window
  150.    ; SoftwareDescription  - Long name, Displayed in NCPA dlg box in 
  151.    ;                        'Description' window when software selected
  152.    ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  153.    SoftwareTitle              = "TCC Token Ring Driver"
  154.    SoftwareDescription        = "Thomas-Conrad Token Ring Driver"
  155.    ; - - - - - - - - - - - - - - -
  156.  
  157. [DialogConstantsENG]
  158.    ; - - - - - - - - - - - - - - -
  159.    ; NOTE: Adapter Adaptation area
  160.    ; - - - - - - - - - - - - - - -
  161.    Help                    = "&Help"
  162.    Exit                    = "Cancel"
  163.    OK                      = "OK"
  164.    HelpContext             = ""
  165.    Continue                = "Continue"
  166.    Cancel                  = "C&ancel"
  167.    ; - - - - - - - - - - - - - - -
  168.  
  169. [Basic4035DlgENG]
  170.    ; - - - - - - - - - - - - - - -
  171.    ; NOTE: Adapter Adaptation area
  172.    ; - - - - - - - - - - - - - - -
  173.    DlgType                 = "RadioCombination"
  174.    DlgTemplate             = "TCCTOK_4035"
  175.    EditFocusOn             = $(!IDC_COMBO1)
  176.    ReInit                  = NO
  177.    Caption                 = ""
  178.    Combo1List              = $(InterruptTextList)
  179.    Combo1Out               = $(InterruptTextDlgDefault)
  180.    Combo2List              = $(IoBaseTextList)
  181.    Combo2Out               = $(IoBaseTextDlgDefault)
  182.    Combo3List              = $(DmaChannelTextList)
  183.    Combo3Out               = $(DmaChannelTextDlgDefault)
  184.    ComboListItemsIn        = {Combo1List,Combo2List,Combo3List}
  185.    ComboListItemsOut       = {Combo1Out,Combo2Out,Combo3Out}
  186.    RadioIn                 = ""
  187. ;; since AdvancedDlgENG is using EditText, we can't...
  188.    EditTextIn              = ""
  189.    EditTextLim             = ""
  190.    NotifyFields            = {NO, NO, NO}
  191.    HelpContext             = ""
  192.    ; - - - - - - - - - - - - - - -
  193.  
  194.  
  195. [Basic4045DlgENG]
  196.    ; - - - - - - - - - - - - - - -
  197.    ; NOTE: Adapter Adaptation area
  198.    ; - - - - - - - - - - - - - - -
  199.    DlgType                 = "RadioCombination"
  200.    DlgTemplate             = "TCCTOK_4045"
  201.    EditFocusOn             = $(!IDC_COMBO1)
  202.    ReInit                  = NO
  203.    Caption                 = ""
  204.    Combo1List              = $(InterruptTextList)
  205.    Combo1Out               = $(InterruptTextDlgDefault)
  206.    Combo2List              = $(IoBaseTextList)
  207.    Combo2Out               = $(IoBaseTextDlgDefault)
  208.    Combo3List              = $(DmaChannelTextList)
  209.    Combo3Out               = $(DmaChannelTextDlgDefault)
  210.    ComboListItemsIn        = {Combo1List,Combo2List,Combo3List}
  211.    ComboListItemsOut       = {Combo1Out,Combo2Out,Combo3Out}
  212.    RadioIn                 = { $(SpeedIntDlgDefault) }
  213. ;; since AdvancedDlgENG is using EditText, we can't...
  214.    EditTextIn              = ""
  215.    EditTextLim             = ""
  216.    NotifyFields            = {NO, NO, NO}
  217.    HelpContext             = ""
  218.    ; - - - - - - - - - - - - - - -
  219.  
  220. [Basic4046DlgENG]
  221.    ; - - - - - - - - - - - - - - -
  222.    ; NOTE: Adapter Adaptation area
  223.    ; - - - - - - - - - - - - - - -
  224.    DlgType                 = "RadioCombination"
  225.    DlgTemplate             = "TCCTOK_4046"
  226.    EditFocusOn             = $(!IDC_COMBO1)
  227.    ReInit                  = NO
  228.    Caption                 = ""
  229.    Combo1List              = $(SlotNumberTextList)
  230.    Combo1Out               = $(SlotNumberTextDlgDefault)
  231.    ComboListItemsIn        = {Combo1List}
  232.    ComboListItemsOut       = {Combo1Out}
  233.    RadioIn                 = ""
  234. ;; since AdvancedDlgENG is using EditText, we can't...
  235.    EditTextIn              = ""
  236.    EditTextLim             = ""
  237.    NotifyFields            = {NO}
  238.    HelpContext             = ""
  239.    ; - - - - - - - - - - - - - - -
  240.  
  241. [AdvancedDlgENG]
  242.    ; - - - - - - - - - - - - - - -
  243.    ; NOTE: Adapter Adaptation area
  244.    ; - - - - - - - - - - - - - - -
  245.    DlgType                 = "RadioCombination"
  246.    DlgTemplate             = "TCCTOK_ADVANCED"
  247.    EditFocusOn             = $(IDC_EDIT1)
  248.    ReInit                  = NO
  249.    Caption                 = $(FunctionTitle)
  250. ;; since Basic4045DlgENG is using ComboList and Radio, we can't...   
  251. ;; ComboListItemsIn        = ""
  252. ;; ComboListItemsOut       = ""
  253. ;; RadioIn                 = ""
  254.    EditField1              = $(PacketSizeTextDlgDefault)
  255.    EditField2              = $(NetAddressTextDlgDefault)
  256.    EditField3              = $(ProductIdTextDlgDefault)
  257.    EditTextIn              = { $(EditField1), $(EditField2), $(EditField3) }
  258.    EditTextLim             = { 5, 17 36 }
  259.    NotifyFields            = ""
  260.    HelpContext             = ""
  261.    ; - - - - - - - - - - - - - - -
  262.  
  263. [Identify]
  264.    ; ----------------------------------------------------------------
  265.    ; Identify ourselves as an NT installation script file
  266.    ; and tell setup about us and our installation diskette
  267.    ; ----------------------------------------------------------------
  268.    set Status          = STATUS_SUCCESSFUL
  269.    set Identifier      = NetAdapter
  270.    set Media           = #("Source Media Descriptions", 1, 1)
  271.    Return $(Status) $(Identifier) $(Media)
  272.  
  273. [ReturnOptions]
  274.    ; ----------------------------------------------------------------
  275.    ; If we support the requested language, return the NCPA variable
  276.    ; list and its matching text list, so the user can select an
  277.    ; option to process
  278.    ; ----------------------------------------------------------------
  279.    set Status          = STATUS_FAILED
  280.    set OptionList      = {}
  281.    set OptionTextList  = {}
  282.    set LanguageList    = ^(LanguagesSupported, 1)
  283.    Ifcontains(i) $($0) in $(LanguageList)
  284.       ifstr(i) $($1) == ""
  285.          goto ReturnOptions_Set
  286.       endif
  287.       set PlatformList = ^(PlatformsSupported, 1)
  288.       Ifcontains(i) $($1) in $(PlatformList)
  289.          goto ReturnOptions_Set
  290.       else
  291.          set Status = STATUS_NOTSUPPORTED
  292.          goto ReturnOptions_Exit
  293.       endif
  294.    else
  295.       set Status = STATUS_NOLANGUAGE
  296.       goto ReturnOptions_Exit
  297.    endif
  298. ReturnOptions_Set = +
  299.     set OptionList      = ^(OptList$($0), 1)
  300.     set OptionTextList  = ^(OptList$($0), 2)
  301.     set Status          = STATUS_SUCCESSFUL
  302. ReturnOptions_Exit = +
  303.     Return $(Status) $(OptionList) $(OptionTextList)
  304.  
  305. [LanguagesSupported]
  306.    ENG
  307.  
  308. [GeneralConstants]
  309.    from                     = ""
  310.    to                       = ""
  311.    ExitCodeOk               = 0
  312.    ExitCodeCancel           = 1
  313.    ExitCodeFatal            = 2
  314.    Key_Null                 = ""
  315.    MAXIMUM_ALLOWED          = 33554432
  316.    RegistryErrorIndex       = NO_ERROR
  317.    Key_Product              = ""
  318.    Key_HardwareParameters   = ""
  319.    TRUE                     = 1
  320.    FALSE                    = 0
  321.    NoTitle                  = 0
  322.    ExitState                = "Active"
  323.    OldVersionExisted        = $(FALSE)
  324.    DriverPath               = $(!STF_NTPATH)\drivers
  325.                            
  326. [date]                     
  327.    Now                      = {} ? $(!LIBHANDLE) GetSystemDate
  328.  
  329. [ProductType]
  330.    STF_PRODUCT  = Winnt
  331.    STF_PLATFORM = I386
  332.  
  333. [PlatformsSupported]
  334.    ISA
  335.    EISA
  336.    MCA
  337.  
  338. [Install-Option]
  339.    Debug-Output "$(STF_CONTEXTINFNAME): Entering Install-Option"
  340.    set STF_VITAL = ""
  341.    ifstr(i) $(AddCopy) == "YES"
  342.       set STF_VITAL = "YES"
  343.       AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  344.       AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  345.    endif
  346.    ifstr(i) $(DoCopy) == "YES"
  347.       set STF_VITAL = "YES"
  348.       set !STF_NCPA_FLUSH_COPYLIST = TRUE
  349.       CopyFilesInCopyList
  350.     else
  351.         LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(SrcDir)\tctoknt.dll $(!STF_WINDOWSSYSPATH)\tctoknt.dll
  352.    endif
  353.    ifstr(i) $(DoConfig) == "YES"
  354.    endif
  355.    exit
  356.  
  357. [Install-Update]
  358.    Debug-Output "$(STF_CONTEXTINFNAME): Entering Install-Update"
  359.    set STF_VITAL        = "YES"
  360.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  361.    AddSectionFilesToCopyList Files-Driver $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  362.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  363.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  364.    CopyFilesInCopyList
  365.    exit
  366.  
  367. [Remove-Option]
  368.    Debug-Output "$(STF_CONTEXTINFNAME): Entering Remove-Option"
  369.    set RemoveList = {}
  370.    set RemoveList = >($(RemoveList), $(!STF_WINDOWSSYSPATH)"\drivers\"$(TccBaseName)"nt.sys")
  371.    set RemoveList = >($(RemoveList), $(!STF_WINDOWSSYSPATH)"\drivers\eaglecaf.bin")
  372.    set RemoveList = >($(RemoveList), $(!STF_WINDOWSSYSPATH)"\"$(TccBaseName)"nt.dll")
  373.    set RemoveList = >($(RemoveList), $(STF_CONTEXTINFNAME))
  374.    ForListDo $(RemoveList)
  375.       Debug-Output "Removing .$($)."
  376.       LibraryProcedure Status , $(!LIBHANDLE), DelFile $($)
  377.    EndForListDo
  378.    exit
  379.  
  380. [InstallOption]
  381. ;;   set !DebugOutputControl = 1
  382. ;;   set !STF_DISPLAYDEBUGOUTPUT = 1
  383.    set TccOption = $($1)
  384.    set SrcDir    = $($2)
  385.    set AddCopy   = $($3)
  386.    set DoCopy    = $($4)
  387.    set DoConfig  = $($5)
  388.    Debug-Output "$(STF_CONTEXTINFNAME): Entering InstallOption"
  389.    Debug-Output "$(STF_CONTEXTINFNAME): STF_CWDIR: .$(!STF_CWDIR)."
  390.    Debug-Output "$(STF_CONTEXTINFNAME): STF_LANGUAGE: .$(!STF_LANGUAGE)."
  391.    Debug-Output "$(STF_CONTEXTINFNAME): !NTN_RegBase .$(!NTN_RegBase)."
  392.    Debug-Output "$(STF_CONTEXTINFNAME): !NTN_SoftwareBase .$(!NTN_SoftwareBase)."
  393.    Debug-Output "$(STF_CONTEXTINFNAME): TccOption: .$(TccOption). SrcDir: .$(SrcDir)."
  394.    Debug-Output "$(STF_CONTEXTINFNAME): AddCopy: .$(AddCopy). DoCopy: .$(DoCopy). DoConfig: .$(DoConfig)."
  395.    set LanguageList = ^(LanguagesSupported, 1)
  396.    Ifcontains(i) $($0) NOT-IN $(LanguageList)
  397.       Return STATUS_NOLANGUAGE
  398.    endif
  399.    set-subst LF = "\n"
  400.    ; ----------------------------------------------------------------
  401.    ; Pick up the general constants and file constants
  402.    ; ----------------------------------------------------------------
  403.    read-syms GeneralConstants
  404.    read-syms FileConstants
  405.    ; ----------------------------------------------------------------
  406.    ; Pick up the variables for this option (as selected by user)
  407.    ; These would normally reside in FileConstants, but there's no
  408.    ; dynamic selection mechanism supported in a read-syms section.
  409.    ; ----------------------------------------------------------------
  410.    set OptionNameList           = ^(OptList$(!STF_LANGUAGE), 1 )
  411.    set OptionHdwrNameList       = ^(OptList$(!STF_LANGUAGE), 3 )
  412.    set OptionHdwrTitleList      = ^(OptList$(!STF_LANGUAGE), 4 )
  413.    set OptionHdwrDescList       = ^(OptList$(!STF_LANGUAGE), 5 )
  414.    set ProductHdwrName          = *($(OptionHdwrNameList),+
  415.                                   ~($(OptionNameList), $(TccOption)))
  416.    set ProductHdwrTitle         = *($(OptionHdwrTitleList),+
  417.                                   ~($(OptionNameList), $(TccOption)))
  418.    set ProductHdwrDesc          = *($(OptionHdwrDescList),+
  419.                                   ~($(OptionNameList), $(TccOption)))
  420.    Debug-Output "$(STF_CONTEXTINFNAME): ProductHdwrName .$(ProductHdwrName)."
  421.    Debug-Output "$(STF_CONTEXTINFNAME): ProductHdwrTitle .$(ProductHdwrTitle)."
  422.    Debug-Output "$(STF_CONTEXTINFNAME): ProductHdwrDesc .$(ProductHdwrDesc)."
  423.    read-syms DialogConstants$(!STF_LANGUAGE)
  424.    ifstr(i) $(!NTN_Origination) == "NCPA"
  425.       set Continue = "OK"
  426.    endif
  427.    read-syms FileConstants$(!STF_LANGUAGE)
  428.    detect date
  429.    set-title $(FunctionTitle)
  430.    set to   = InstallOptionDispatch
  431.    set from = InstallOptionDispatch
  432.    set CommonStatus = STATUS_SUCCESSFUL
  433.    EndWait
  434.  
  435. InstallOptionDispatch = +
  436.    Debug-Output "$(STF_CONTEXTINFNAME): Entering InstallOptionDispatch"
  437.    ; ----------------------------------------------------------------
  438.    ; Figure out which label we need to dispatch to and
  439.    ; what our error recovery 'features' will be
  440.    ; ----------------------------------------------------------------
  441.    Ifstr(i) $(!NTN_InstallMode) == deinstall
  442.       set StartLabel = RemoveAdapterFromRegistry
  443.    else-Ifstr(i) $(!NTN_InstallMode) == Update
  444.       set StartLabel = UpgradeSoftware
  445.    else-Ifstr(i) $(!NTN_InstallMode) == bind
  446.       set StartLabel = CheckAdapterBinding
  447.    else-Ifstr(i) $(!NTN_InstallMode) == configure
  448.       set StartLabel = GetAdapterConfigFromRegistry
  449.       ; ----------------------------------------------------------------
  450.       ; We're going to configure, disallow configuring the driver
  451.       ; ----------------------------------------------------------------
  452.       Ifstr(i) $(KeyName_Software) == $(!NTN_RegBase)
  453.          Debug-Output "$(STF_CONTEXTINFNAME): Cannot configure driver software."
  454.          Shell $(UtilityInf), RegistryErrorString, CANNOT_CONFIGURE_SOFTWARE
  455.          ifint $($ShellCode) != $(!SHELL_CODE_OK)
  456.             set ShellErrorSection = UtilityInf:RegistryErrorString
  457.             goto ShellCodeError
  458.          endif
  459.          set Error = $($R0)
  460.          set from = InstallOptionExit
  461.          set to = InstallOptionExit
  462.          goto SetNonFatalInfo
  463.       endif
  464.    else
  465.       set StartLabel = TestForExistingInstallation
  466.       set OEM_ABANDON_OPTIONS = {}
  467.       set OEM_ABANDON_SOFTWARE = FALSE
  468.       set OEM_ABANDON_ON = TRUE
  469.    endif
  470.    ; ----------------------------------------------------------------
  471.    ; Establish defaults for all configurable values
  472.    ; ----------------------------------------------------------------
  473.    ; - - - - - - - - - - - - - - -
  474.    ; NOTE: Adapter Adaptation area
  475.    ; - - - - - - - - - - - - - - -
  476.    set AdapterTypeValue       = 1
  477.    set DmaChannelValue        = *( $(DmaChannelValueList), 1 )
  478.    set InterruptValue         = *( $(InterruptValueList), 1 )
  479.    set IoBaseValue            = *( $(IoBaseValueList), 1 )
  480.    set McaPosIdValue          = 81
  481.    set NetAddressValue        = ""
  482.    set PacketSizeValue        = 16384
  483.    set ProductIdValue         = ""
  484.    set SlotNumberValue        = *( $(SlotNumberValueList), 1 )
  485.    set SpeedValue             = *( $(SpeedValueList), 2 )
  486.    ; - - - - - - - - - - - - - - -
  487.    ; ----------------------------------------------------------------
  488.    ; Set the from/to labels vars for error cases, and dispatch...
  489.    ; ----------------------------------------------------------------
  490.    set from                   = $(FatalError)
  491.    set to                     = $(FatalError)
  492.    goto $(StartLabel)
  493.  
  494. TestForExistingInstallation = +
  495.    ; ----------------------------------------------------------------
  496.    ; Test the registry for an existing installation.
  497.    ; ----------------------------------------------------------------
  498.    ; Try to open the registry key for the driver so we can determine
  499.    ; if a driver and adapter card are already installed.
  500.    ; ----------------------------------------------------------------
  501.    set OldVersionExisted = $(FALSE)
  502.    Debug-Output "$(STF_CONTEXTINFNAME): Entering TestForExistingInstallation"
  503.    OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_Software) $(MAXIMUM_ALLOWED) Key_Product
  504.    Ifstr $(Key_Product) != $(Key_Null)
  505.       CloseRegKey $(Key_Product)
  506.       ; ----------------------------------------------------------------
  507.       ; Disallow multiple installs of the driver
  508.       ; ----------------------------------------------------------------
  509.       ifstr(i) $(!NTN_RegBase) == $(KeyName_Software)
  510.          Shell $(UtilityInf), VerExistedDlg, $(SoftwareTitle), $(SoftwareVersion)
  511.          ifint $($ShellCode) != $(!SHELL_CODE_OK)
  512.             set ShellErrorSection = UtilityInf:VerExistedDlg
  513.             goto ShellCodeError
  514.          endif
  515.          goto end
  516.       else
  517.          ; ----------------------------------------------------------------
  518.          ; Allow multiple installs of the netcard (with a warning)
  519.          ; ----------------------------------------------------------------
  520.          Shell $(UtilityInf), CardExistedDlg
  521.          ifint $($ShellCode) != $(!SHELL_CODE_OK)
  522.             set ShellErrorSection = UtilityInf:CardExistedDlg
  523.             goto ShellCodeError
  524.          endif
  525.          ifstr(i) $($R1) == "OK"
  526.             set OldVersionExisted = $(TRUE)
  527.          else
  528.             goto InstallOptionExit
  529.          endif
  530.       endif
  531.    endif
  532.  
  533. CopyAdapterFiles = +
  534.    ; ----------------------------------------------------------------
  535.    ; Copy the adapter files from the diskette.
  536.    ; ----------------------------------------------------------------
  537.    ; If we're already installed and it's configure mode, skip this
  538.    ; and go get the configuration from the user.
  539.    ; If we're not installed and it's install mode, and copy mode
  540.    ; is set, ask the user for the install diskette, then install the
  541.    ; option section (which has the .sys, .dll files enumerated).
  542.    ; Our OEMSETNT.INF file has already been copied to the system
  543.    ; directory and renamed to OEMNADx.inf.
  544.    ; ----------------------------------------------------------------
  545.    Debug-Output "$(STF_CONTEXTINFNAME): Entering CopyAdapterFiles"
  546.    ifint $(OldVersionExisted) == $(TRUE)
  547.       ifstr(i) $(!NTN_InstallMode) == configure
  548.          goto GetAdapterConfigFromUser
  549.       endif
  550.    endif
  551.    StartWait
  552.    ifint $(OldVersionExisted) == $(FALSE)
  553.       ifstr(i) $(!NTN_InstallMode) == "install"
  554.          Ifstr(i) $(DoCopy) == "YES"
  555.             Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  556.             Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  557.                set ShellErrorSection = UtilityInf:DoAskSource
  558.                Goto ShellCodeError
  559.             Else-Ifstr(i) $($R0) == STATUS_FAILED
  560.                Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  561.                ifint $($ShellCode) != $(!SHELL_CODE_OK)
  562.                   set ShellErrorSection = UtilityInf:RegistryErrorString
  563.                   goto ShellCodeError
  564.                endif
  565.                set Error = $($R0)
  566.                Goto FatalError
  567.             Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  568.                Goto ProcessSuccessExit
  569.             Endif
  570.             Set SrcDir = $($R1)
  571.          Endif
  572.          install "Install-Option"
  573.          ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  574.             Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  575.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  576.                set ShellErrorSection = UtilityInf:RegistryErrorString
  577.                goto ShellCodeError
  578.             endif
  579.             set Error = $($R0)
  580.             goto FatalError
  581.          endif
  582.       endif
  583.    endif
  584.  
  585. GetAdapterConfigFromRegistry = +
  586.    ; ----------------------------------------------------------------
  587.    ; Get the existing adapter's configuration from the registry
  588.    ; ----------------------------------------------------------------
  589.    ; If we're install mode, there's no existing configuration, so
  590.    ; skip this and go ask the user for the configuration
  591.    ; ----------------------------------------------------------------
  592.    Debug-Output "$(STF_CONTEXTINFNAME): Entering GetAdapterConfigFromRegistry"
  593.    ifstr(i) $(!NTN_InstallMode) == "install"
  594.       goto GetAdapterConfigFromUser
  595.    else
  596.       ; ----------------------------------------------------------------
  597.       ; Ensure that we have an open product key
  598.       ; ----------------------------------------------------------------
  599.       Ifstr $(Key_Product) == $(Key_Null)
  600.          OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) Key_Product
  601.          Ifstr $(Key_Product) == $(Key_Null)
  602.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  603.             Debug-Output $(STF_CONTEXTINFNAME)": Cannot find component product key"
  604.             goto FatalRegistryError
  605.          Endif
  606.       Endif
  607.       ; ----------------------------------------------------------------
  608.       ; Find our netcard service key and open it
  609.       ; ----------------------------------------------------------------
  610.       Shell $(UtilityInf) FindService, $(Key_Product)
  611.       Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  612.          set ShellErrorSection = UtilityInf:FindService
  613.          Goto ShellCodeError
  614.       Endif
  615.       Ifstr(i) $($R0) != NO_ERROR
  616.          Debug-Output "$(STF_CONTEXTINFNAME): Utility:FindService error: $($R0)"
  617.          Goto FatalRegistryError
  618.       endif
  619.       set Key_HardwareParameters = $($R2)
  620.       ; ----------------------------------------------------------------
  621.       ; Close the service key and open our netcard parameters key
  622.       ; ----------------------------------------------------------------
  623.       CloseRegKey $($R1)
  624.       Ifstr $(Key_HardwareParameters) == $(Key_Null)
  625.          set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  626.          Debug-Output $(STF_CONTEXTINFNAME)": Cannot find component service"
  627.          goto FatalRegistryError
  628.       endif
  629.       set OldVersionExisted = $(TRUE)
  630.       set ValueName = ""
  631.       set ValueData = ""
  632.       set ValueStr  = ""
  633.       set ValueList = {}
  634.       ; ----------------------------------------------------------------
  635.       ; Walk the hardware service parameters value list and pick up
  636.       ; (and save off) any values we're interested in.
  637.       ; ----------------------------------------------------------------
  638.       EnumRegValue $(Key_HardwareParameters) ValueList
  639.       ForListDo $(ValueList)
  640.          set ValueItem = $($)
  641.          set ValueName = *($(ValueItem),1)
  642.          set ValueData = *($(ValueItem),4)
  643.          ; - - - - - - - - - - - - - - -
  644.          ; NOTE: Adapter Adaptation area
  645.          ; - - - - - - - - - - - - - - -
  646.          Ifstr(i) $(ValueName) == "AdapterType"
  647.             set AdapterTypeValue = $(ValueData)
  648.          else-Ifstr(i) $(ValueName) == "DmaChannel"
  649.             set DmaChannelValue  = $(ValueData)
  650.          else-Ifstr(i) $(ValueName) == "Interrupt"
  651.             set InterruptValue  = $(ValueData)
  652.          else-Ifstr(i) $(ValueName) == "IoBase"
  653.             set IoBaseValue  = $(ValueData)
  654.          else-Ifstr(i) $(ValueName) == "NetAddress"
  655.             set NetAddressValue  = $(ValueData)
  656.          else-Ifstr(i) $(ValueName) == "PacketSize"
  657.             set PacketSizeValue  = $(ValueData)
  658.          else-Ifstr(i) $(ValueName) == "ProductId"
  659.             set ProductIdValue  = $(ValueData)
  660.          else-Ifstr(i) $(ValueName) == "Speed"
  661.             set SpeedValue  = $(ValueData)
  662.          else-Ifstr(i) $(ValueName) == "SlotNumber"
  663.             set SlotNumberValue  = $(ValueData)
  664.          endif
  665.          ; - - - - - - - - - - - - - - -
  666.          Debug-Output "$(STF_CONTEXTINFNAME): $(ValueName) == .$(ValueData)."
  667.       EndForListDo
  668.    Endif
  669.  
  670. GetAdapterConfigFromUser = +
  671.    ; ----------------------------------------------------------------
  672.    ; Get/Confirm the adapter's configuration from/with the user
  673.    ; ----------------------------------------------------------------
  674.    ; Load our DLL so we can get to our dialog box, then render the 
  675.    ; current configurable values (that have been previously been set
  676.    ; to defaults or have had registry info plugged in) into textual 
  677.    ; defaults for the dialog box
  678.    ; ----------------------------------------------------------------
  679.    Debug-Output "$(STF_CONTEXTINFNAME): Entering GetAdapterConfigFromUser"
  680.    LoadLibrary $(Media) $(!STF_WINDOWSSYSPATH)\$(TccBaseName)nt.dll hLib
  681.    set from = GetAdapterConfigFromUser
  682. GetAdpCfgFromUserOuterLoop = +
  683.    Debug-Output "$(STF_CONTEXTINFNAME): Entering Basic..."
  684.    ; - - - - - - - - - - - - - - -
  685.    ; NOTE: Adapter Adaptation area
  686.    ; - - - - - - - - - - - - - - -
  687.    set InterruptTextDlgDefault   = *($(InterruptTextList),+
  688.                                    ~($(InterruptValueList), +
  689.                                      $(InterruptValue)))
  690.    set IoBaseTextDlgDefault      = *($(IoBaseTextList),+
  691.                                    ~($(IoBaseValueList), +
  692.                                      $(IoBaseValue)))
  693.    set DmaChannelTextDlgDefault  = *($(DmaChannelTextList),+
  694.                                    ~($(DmaChannelValueList), +
  695.                                      $(DmaChannelValue)))
  696.    set SlotNumberTextDlgDefault  = *($(SlotNumberTextList),+
  697.                                    ~($(SlotNumberValueList), +
  698.                                      $(SlotNumberValue)))
  699.    set SpeedIntDlgDefault        = *($(SpeedRadioButtonIdxList),+
  700.                                    ~($(SpeedValueList), +
  701.                                     $(SpeedValue)))
  702.    ; ----------------------------------------------------------------
  703.    ; Get the dialog strings for the appropriate dialog box,
  704.    ; and ask the user for the configuration.
  705.    ; ----------------------------------------------------------------
  706.    ifstr(i) $(TccOption) == "tc$4035e"
  707.       read-syms Basic4035Dlg$(!STF_LANGUAGE)
  708.    else-ifstr(i) $(TccOption) == "tc$4045e"
  709.          read-syms Basic4045Dlg$(!STF_LANGUAGE)
  710.       else
  711.          read-syms Basic4046Dlg$(!STF_LANGUAGE)
  712.       endif 
  713.    endif 
  714.    ui start "InputDlg" $(hLib)
  715.    ifstr(i) $(DLGEVENT) == "CONTINUE"
  716.       ; ----------------------------------------------------------------
  717.       ; The user accepted, render the returned textual values back into 
  718.       ; actual values.  For ISA, it's Interrupt, IoBase, and DmaChannel,
  719.       ; Slot will end up being zero.  For MCA, we're only interested 
  720.       ; in Slot, so Interrupt, IoBase, and DmaChannel will end up zero.
  721.       ; ----------------------------------------------------------------
  722.       set InterruptValue  = *($(InterruptValueList),+
  723.                             ~($(InterruptTextList),+
  724.                              $(Combo1Out)))
  725.       set IoBaseValue     = *($(IoBaseValueList),+
  726.                             ~($(IoBaseTextList),+
  727.                              $(Combo2Out)))
  728.       set DmaChannelValue = *($(DmaChannelValueList),+
  729.                             ~($(DmaChannelTextList),+
  730.                              $(Combo3Out)))
  731.       set SlotNumberValue = *($(SlotNumberValueList),+
  732.                             ~($(SlotNumberTextList),+
  733.                               $(Combo1Out)))
  734.       set SpeedValue      = *($(SpeedValueList),+
  735.                             ~($(SpeedRadioButtonIdxList),+
  736.                             *($(RadioOut),1)))
  737.       Debug-Output "$(STF_CONTEXTINFNAME): User Accepted Basic configuration as follows:"
  738.       Debug-Output "$(STF_CONTEXTINFNAME): InterruptValue   == .$(InterruptValue)."
  739.       Debug-Output "$(STF_CONTEXTINFNAME): IoBaseValue      == .$(IoBaseValue)."
  740.       Debug-Output "$(STF_CONTEXTINFNAME): DmaChannelValue  == .$(DmaChannelValue)."
  741.       Debug-Output "$(STF_CONTEXTINFNAME): SlotNumberValue  == .$(SlotNumberValue)."
  742.       Debug-Output "$(STF_CONTEXTINFNAME): SpeedValue       == .$(SpeedValue)."
  743.       ; - - - - - - - - - - - - - - -
  744.       ui pop 1
  745.       FreeLibrary $(hLib)
  746.  
  747.    else-ifstr(i) $(DLGEVENT) == "EXIT"
  748. GetAdapterAdvancedConfigFromUser = +
  749.       ; ----------------------------------------------------------------
  750.       ; This is a Klooge.  We're using the control ID for exit to get to
  751.       ; the advanced menu, but it beats rolling our own dialog code, eh?
  752.       ; ----------------------------------------------------------------
  753.       Debug-Output "$(STF_CONTEXTINFNAME): Entering Advanced..."
  754.       set PacketSizeTextDlgDefault  = $(PacketSizeValue)
  755.       set NetAddressTextDlgDefault  = $(NetAddressValue)
  756.       set ProductIdTextDlgDefault   = $(ProductIdValue)
  757.       read-syms AdvancedDlg$(!STF_LANGUAGE)
  758.       ui start "AdvancedDlg" $(hLib)
  759.       ifstr(i) $(DLGEVENT) == "CONTINUE"
  760.          set PacketSizeValue  = *($(EditTextOut),1)
  761.          set NetAddressValue  = *($(EditTextOut),2)
  762.          set ProductIdValue   = *($(EditTextOut),3)
  763.          Debug-Output "$(STF_CONTEXTINFNAME): User accepted Advanced configuration as follows:"
  764.          Debug-Output "$(STF_CONTEXTINFNAME): PacketSizeValue == .$(PacketSizeValue)."
  765.          Debug-Output "$(STF_CONTEXTINFNAME): NetAddressValue == .$(NetAddressValue)."
  766.          Debug-Output "$(STF_CONTEXTINFNAME): ProductIdValue  == .$(ProductIdValue)."
  767.       endif
  768.       ; ----------------------------------------------------------------
  769.       ; Done with advanced, remove our dialog and go back to the
  770.       ; earlier one (mca or isa, as appropriate)
  771.       ; ----------------------------------------------------------------
  772.       ui pop 1
  773.       goto GetAdpCfgFromUserOuterLoop
  774.  
  775.    else-ifstr(i) $(DLGEVENT) == "CANCEL"
  776.       ; ----------------------------------------------------------------
  777.       ; The user cancelled, exit
  778.       ; ----------------------------------------------------------------
  779.       Debug-Output "$(STF_CONTEXTINFNAME): Dialog DLGEVENT = .$(DLGEVENT).  Bye."
  780.       set CommonStatus = STATUS_USERCANCEL
  781.       ui pop 1
  782.       FreeLibrary $(hLib)
  783.       goto InstallOptionExit
  784.  
  785.    else
  786.       ; ----------------------------------------------------------------
  787.       ; The user did something we can't understand, exit
  788.       ; ----------------------------------------------------------------
  789.       Debug-Output "$(STF_CONTEXTINFNAME): Dialog DLGEVENT = .$(DLGEVENT).  Bye."
  790.       ui pop 1
  791.       FreeLibrary $(hLib)
  792.       goto InstallOptionExit
  793.  
  794.    endif
  795.  
  796. AddAdapterSoftwareToRegistry = +
  797.    ; ----------------------------------------------------------------
  798.    ; Add Adapter Software (Driver) information to the registry
  799.    ; ----------------------------------------------------------------
  800.    Ifstr(i) $(!NTN_InstallMode) == configure
  801.       goto AddAdapterConfigurationToRegistry
  802.    Endif
  803.    ifint $(OldVersionExisted) == $(TRUE)
  804.       goto AddAdapterHardwareToRegistry
  805.    Endif
  806.    ; ----------------------------------------------------------------
  807.    ; Add the Software Component (driver) to the registry.
  808.    ; This will create keys and values as follows:
  809.    ;
  810.    ; \SOFTWARE\$(Manufacturer)\$(TccBaseName)\CurrentVersion
  811.    ; \SOFTWARE\$(Manufacturer)\$(TccBaseName)\CurrentVersion:RefCount
  812.    ; \SOFTWARE\$(Manufacturer)\$(TccBaseName)\CurrentVersion:ServiceName
  813.    ; \SOFTWARE\$(Manufacturer)\$(TccBaseName)\CurrentVersion\NetRules
  814.    ; \SYSTEM\CurrentControlSet\$(TccBaseName)
  815.    ; \SYSTEM\CurrentControlSet\$(TccBaseName):DisplayName
  816.    ; \SYSTEM\CurrentControlSet\$(TccBaseName):ErrorControl
  817.    ; \SYSTEM\CurrentControlSet\$(TccBaseName):Group
  818.    ; \SYSTEM\CurrentControlSet\$(TccBaseName):ImagePath
  819.    ; \SYSTEM\CurrentControlSet\$(TccBaseName):Start
  820.    ; \SYSTEM\CurrentControlSet\$(TccBaseName):Type
  821.    ; \SYSTEM\CurrentControlSet\$(TccBaseName)\Linkage
  822.    ; \SYSTEM\CurrentControlSet\$(TccBaseName)\Linkage\Disabled
  823.    ; \SYSTEM\CurrentControlSet\$(TccBaseName)\Parameters
  824.    ; \SYSTEM\CurrentControlSet\$(TccBaseName)\Security
  825.    ; \SYSTEM\CurrentControlSet\$(TccBaseName)\Security:Security
  826.    ; ----------------------------------------------------------------
  827.    Shell $(UtilityInf), +
  828.          AddSoftwareComponent, +
  829.          $(Manufacturer), +
  830.          $(TccBaseName), +
  831.          $(TccBaseName), +
  832.          $(SoftwareTitle), +
  833.          $(STF_CONTEXTINFNAME), +
  834.          $(SoftwareImage), +
  835.          "kernel", "NDIS", {}, "",+
  836.          $(NetEventDLL)
  837.    Set OEM_ABANDON_SOFTWARE = TRUE
  838.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  839.       set ShellErrorSection = UtilityInf:AddSoftwareComponent
  840.       goto ShellCodeError
  841.    endif
  842.    set RegistryErrorIndex = $($R0)
  843.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  844.       EndWait
  845.       Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterSoftware - add component error"
  846.       CloseRegKey $($R1)
  847.       CloseRegKey $($R2)
  848.       CloseRegKey $($R3)
  849.       CloseRegKey $($R4)
  850.       CloseRegKey $($R5)
  851.       goto FatalRegistryError
  852.    endif
  853.    ; ----------------------------------------------------------------
  854.    ; Save the keys we'll use later and close the unused ones
  855.    ; ----------------------------------------------------------------
  856.    Set Key_SoftwareProduct    = $($R1)
  857.    Set Key_SoftwareNetRules   = $($R2)
  858.    CloseRegKey $($R3)
  859.    CloseRegKey $($R4)
  860.    CloseRegKey $($R5)
  861.    ; ----------------------------------------------------------------
  862.    ; Add the Software Product Information values to the registry key
  863.    ; \SOFTWARE\$(Manufacturer)\$(TccBaseName)\CurrentVersion
  864.    ; ----------------------------------------------------------------
  865.    set NewValueList = {+
  866.        {SoftwareType, $(NoTitle), $(!REG_VT_SZ),    $(SoftwareType)},+
  867.        {MajorVersion, $(NoTitle), $(!REG_VT_DWORD), $(SoftwareMajorVersion)},+
  868.        {MinorVersion, $(NoTitle), $(!REG_VT_DWORD), $(SoftwareMinorVersion)},+
  869.        {Title,        $(NoTitle), $(!REG_VT_SZ),    $(SoftwareTitle)},+
  870.        {Description,  $(NoTitle), $(!REG_VT_SZ),    $(SoftwareDescription)},+
  871.        {ServiceName,  $(NoTitle), $(!REG_VT_SZ),    $(TccBaseName)},+
  872.        {InstallDate,  $(NoTitle), $(!REG_VT_DWORD), *($(Now),1)}+
  873.        }
  874.    Shell  $(UtilityInf), AddValueList, $(Key_SoftwareProduct), $(NewValueList)
  875.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  876.       set ShellErrorSection = UtilityInf:AddValueList
  877.       goto ShellCodeError
  878.    endif
  879.    Set RegistryErrorIndex = $($R0)
  880.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  881.       EndWait
  882.       Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterSoftware - add value list error"
  883.       CloseRegKey $(Key_SoftwareProduct)
  884.       CloseRegKey $(Key_SoftwareNetRules)
  885.       goto FatalRegistryError
  886.    endif
  887.    ; ----------------------------------------------------------------
  888.    ; Add the Software Product Net Rules values to the registry key
  889.    ; \SOFTWARE\$(Manufacturer)\$(TccBaseName)\CurrentVersion\NetRules
  890.    ; ----------------------------------------------------------------
  891.    Set NewValueList = {+
  892.        {type,      $(NoTitle), $(!REG_VT_SZ),       $(NetRuleSoftwareType)},+
  893.        {use,       $(NoTitle), $(!REG_VT_SZ),       $(NetRuleSoftwareUse)}, +
  894.        {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(NetRuleSoftwareBindForm)}, +
  895.        {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(NetRuleSoftwareClass)}, +
  896.        {bindable,  $(NoTitle), $(!REG_VT_MULTI_SZ), $(NetRuleSoftwareBindable)}, +
  897.        {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(TccOption)}+
  898.        }
  899.    Shell  $(UtilityInf), AddValueList, $(Key_SoftwareNetRules), $(NewValueList)
  900.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  901.       set ShellErrorSection = UtilityInf:AddValueList
  902.       goto ShellCodeError
  903.    endif
  904.    Set RegistryErrorIndex = $($R0)
  905.    CloseRegKey $(Key_SoftwareProduct)
  906.    CloseRegKey $(Key_SoftwareNetRules)
  907.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  908.       EndWait
  909.       Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterSoftware - add NetRule error"
  910.       goto FatalRegistryError
  911.    endif
  912.  
  913. AddAdapterHardwareToRegistry = +
  914.    ; ----------------------------------------------------------------
  915.    ; Add the Hardware Component (net card) the registry
  916.    ; This will create keys and values as follows:
  917.    ;
  918.    ; \SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\...
  919.    ;     ...\$(AdapterNumber)
  920.    ;     ...\$(AdapterNumber)\NetRules
  921.    ; \SYSTEM\CurrentControlSet\Services\...
  922.    ;     ...\$(ProductHdwrName)$(AdapterNumber)
  923.    ;     ...\$(ProductHdwrName)$(AdapterNumber)\Linkage
  924.    ;     ...\$(ProductHdwrName)$(AdapterNumber)\Linkage\Disabled
  925.    ; ----------------------------------------------------------------
  926.    Shell $(UtilityInf), +
  927.          AddHardwareComponent, +
  928.          $(ProductHdwrName), +
  929.          $(STF_CONTEXTINFNAME), +
  930.          $(KeyName_Software)
  931.    ifint $($R4) != -1
  932.       Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  933.    endif
  934.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  935.       set ShellErrorSection = UtilityInf:AddHardwareComponent
  936.       goto ShellCodeError
  937.    endif
  938.    set RegistryErrorIndex = $($R0)
  939.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  940.       EndWait
  941.       Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterHardware - add component error"
  942.       CloseRegKey $($R1)
  943.       CloseRegKey $($R2)
  944.       CloseRegKey $($R3)
  945.       goto FatalRegistryError
  946.    endif
  947.    set Key_HardwareNetRules   = $($R2)
  948.    set Key_HardwareParameters = $($R3)
  949.    set AdapterNumber          = $($R4)
  950.    ; ----------------------------------------------------------------
  951.    ; Add the Hardware Product Information to the registry key
  952.    ; \SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\...
  953.    ;     ...\$(AdapterNumber)
  954.    ; ----------------------------------------------------------------
  955.    set NewValueList = {+
  956.        {Manufacturer, $(NoTitle), $(!REG_VT_SZ),    $(Manufacturer)},+
  957.        {Title,        $(NoTitle), $(!REG_VT_SZ),    "["$($R4)"] "$(ProductHdwrTitle)},+
  958.        {Description,  $(NoTitle), $(!REG_VT_SZ),    $(ProductHdwrDesc)},+
  959.        {ProductName,  $(NoTitle), $(!REG_VT_SZ),    $(ProductHdwrName)},+
  960.        {ServiceName,  $(NoTitle), $(!REG_VT_SZ),    $($R5)},+
  961.        {InstallDate,  $(NoTitle), $(!REG_VT_DWORD), *($(Now),1)}+
  962.        }
  963.    Shell $(UtilityInf), AddValueList, $($R1),  $(NewValueList)
  964.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  965.       set ShellErrorSection = UtilityInf:AddValueList
  966.       goto ShellCodeError
  967.    endif
  968.    CloseRegKey $($R1)
  969.    set TempProdName = """"$(ProductHdwrName)$(AdapterNumber)""""
  970.    set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  971.    ; ----------------------------------------------------------------
  972.    ; Add the Hardware Net Rules to the registry key
  973.    ; \SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\...
  974.    ;     ...\$(AdapterNumber)\NetRules
  975.    ; ----------------------------------------------------------------
  976.    set NewValueList = {+
  977.        {type,      $(NoTitle), $(!REG_VT_SZ),       $(NetRuleHardwareType)},+
  978.        {bindform,  $(NoTitle), $(!REG_VT_SZ),       $(TempBindForm)}, +
  979.        {class,     $(NoTitle), $(!REG_VT_MULTI_SZ), $(NetRuleHardwareClass)}, +
  980.        {InfOption, $(NoTitle), $(!REG_VT_SZ),       $(TccOption)}+
  981.        }
  982.    Shell  $(UtilityInf), AddValueList, $(Key_HardwareNetRules), $(NewValueList)
  983.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  984.       set ShellErrorSection = UtilityInf:AddValueList
  985.       goto ShellCodeError
  986.    endif
  987.    set RegistryErrorIndex = $($R0)
  988.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  989.       EndWait
  990.       Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterHardware - add NetRule error"
  991.       CloseRegKey $(Key_HardwareParameters)
  992.       CloseRegKey $(Key_HardwareNetRules)
  993.       goto FatalRegistryError
  994.    endif
  995.    CloseRegKey $(Key_HardwareNetRules)
  996.    goto AddAdapterConfigurationToRegistry
  997.  
  998. AddAdapterConfigurationToRegistry = +
  999.    Debug-Output "$(STF_CONTEXTINFNAME): Entering AddAdapterConfigurationToRegistry"
  1000.  
  1001.             Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  1002.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1003.                 Debug-Output "ShellCode error."
  1004.                 goto ShellCodeError
  1005.             endif
  1006.             set BusTypeValue = $($R1)
  1007.             set BusNumber = $($R2)
  1008. ;davidlao
  1009. ;   Shell $(UtilityInf), GetBusTypeNum
  1010. ;   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1011. ;      set ShellErrorSection = UtilityInf:GetBusTypeNum
  1012. ;      goto ShellCodeError
  1013. ;   endif
  1014. ;   set BusTypeValue = $($R1)
  1015.    ; ----------------------------------------------------------------
  1016.    ; Add the Hardware configuration information to the registry key
  1017.    ; \SYSTEM\CurrentControlSet\Services\$(ProductHdwrName)$(AdapterNumber)
  1018.    ; ----------------------------------------------------------------
  1019.    ; - - - - - - - - - - - - - - -
  1020.    ; NOTE: Adapter Adaptation area
  1021.    ; - - - - - - - - - - - - - - -
  1022.    ifstr(i) $(TccOption) == "tc$4046e"
  1023.       set NewValueList = {+
  1024.           {AdapterType,    $(NoTitle), $(!REG_VT_DWORD), $(AdapterTypeValue)},+
  1025.           {BusType,        $(NoTitle), $(!REG_VT_DWORD), $(BusTypeValue)},+
  1026.           {BusNumber,      $(NoTitle), $(!REG_VT_DWORD), 0},+
  1027.           {MediaType,      $(NoTitle), $(!REG_VT_DWORD), 2},+
  1028.           {McaPosId,       $(NoTitle), $(!REG_VT_DWORD), $(McaPosIdValue)},+
  1029.           {NetAddress,     $(NoTitle), $(!REG_VT_SZ),    $(NetAddressValue)},+
  1030.           {PacketSize,     $(NoTitle), $(!REG_VT_DWORD), $(PacketSizeValue)},+
  1031.           {ProductId,      $(NoTitle), $(!REG_VT_SZ),    $(ProductIdValue)},+
  1032.           {SlotNumber,     $(NoTitle), $(!REG_VT_DWORD), $(SlotNumberValue)},+
  1033.           {Speed,          $(NoTitle), $(!REG_VT_DWORD), $(SpeedValue)}+
  1034.           }
  1035.    else
  1036.       set NewValueList = {+
  1037.           {AdapterType,    $(NoTitle), $(!REG_VT_DWORD), $(AdapterTypeValue)},+
  1038.           {BusType,        $(NoTitle), $(!REG_VT_DWORD), $(BusTypeValue)},+
  1039.           {BusNumber,      $(NoTitle), $(!REG_VT_DWORD), 0},+
  1040.           {MediaType,      $(NoTitle), $(!REG_VT_DWORD), 2},+
  1041.           {DmaChannel,     $(NoTitle), $(!REG_VT_DWORD), $(DmaChannelValue)},+
  1042.           {Interrupt,      $(NoTitle), $(!REG_VT_DWORD), $(InterruptValue)},+
  1043.           {IoBase,         $(NoTitle), $(!REG_VT_DWORD), $(IoBaseValue)},+
  1044.           {NetAddress,     $(NoTitle), $(!REG_VT_SZ),    $(NetAddressValue)},+
  1045.           {PacketSize,     $(NoTitle), $(!REG_VT_DWORD), $(PacketSizeValue)},+
  1046.           {ProductId,      $(NoTitle), $(!REG_VT_SZ),    $(ProductIdValue)},+
  1047.           {Speed,          $(NoTitle), $(!REG_VT_DWORD), $(SpeedValue)}+
  1048.           }
  1049.    endif
  1050.    ; - - - - - - - - - - - - - - -
  1051.    Shell  $(UtilityInf), AddValueList, $(Key_HardwareParameters), $(NewValueList)
  1052.    CloseRegKey $(Key_HardwareParameters)
  1053.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1054.       set ShellErrorSection = UtilityInf:AddValueList
  1055.       goto ShellCodeError
  1056.    endif
  1057.    set RegistryErrorIndex = $($R0)
  1058.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1059.       Debug-Output $(STF_CONTEXTINFNAME)": AddAdapterConfiguration - add value list error"
  1060.       goto FatalRegistryError
  1061.    endif
  1062.    EndWait
  1063.    goto ProcessSuccessExit
  1064.  
  1065. CheckAdapterBinding =+
  1066.    Debug-Output "$(STF_CONTEXTINFNAME): Entering CheckAdapterBinding"
  1067.    set Error = "CheckAdapterBinding: not required for this adapter"
  1068.    goto FatalError
  1069.  
  1070. RemoveAdapterFromRegistry = +
  1071.    ; ----------------------------------------------------------------
  1072.    ; Remove the adapter by removing the hardware component.
  1073.    ; ----------------------------------------------------------------
  1074.    ; When the registry reference count reaches zero, the software
  1075.    ; component will automatically be removed.  If the last adapter
  1076.    ; is being removed from the registry, delete the associated
  1077.    ; file as well.  Lastly, remove the \SOFTWARE\$(Manufacturer) key
  1078.    ; if it's empty.
  1079.    ; ----------------------------------------------------------------
  1080.    Debug-Output "$(STF_CONTEXTINFNAME): Entering RemoveAdapterFromRegistry"
  1081.    OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_Software) $(MAXIMUM_ALLOWED) KeyToReferenceCount
  1082.    Ifstr $(KeyToReferenceCount) == ""
  1083.       Debug-Output "$(STF_CONTEXTINFNAME): Could not open Software Base Key"
  1084.       set RefCountBeforeRemove = 2
  1085.       goto InstallOptionExit
  1086.    endif
  1087.    GetRegValue $(KeyToReferenceCount),"RefCount", RefCountInfo
  1088.    set RefCountBeforeRemove = *($(RefCountInfo), 4)
  1089.    CloseRegKey $(KeyToReferenceCount)
  1090.    Debug-Output "$(STF_CONTEXTINFNAME): Removing Hardware Component"
  1091.    Shell $(UtilityInf), +
  1092.          RemoveHardwareComponent, +
  1093.          $(Manufacturer), +
  1094.          $(TccBaseName), +
  1095.          $(!NTN_RegBase)
  1096.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1097.       set ShellErrorSection = UtilityInf:RemoveHardwareComponent
  1098.       goto ShellCodeError
  1099.    endif
  1100.    Ifstr(i) $($R0) != NO_ERROR
  1101.       Ifstr(i) $($R0) != REF_COUNT_NOT_ZERO
  1102.          goto FatalRegistryError
  1103.       endif
  1104.    endif
  1105.    ifint $(RefCountBeforeRemove) == 1
  1106.       OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_SoftwareRoot) $(MAXIMUM_ALLOWED) Key_SoftwareRoot
  1107.       EnumRegKey $(Key_SoftwareRoot) KeyList
  1108.       EnumRegValue $(Key_SoftwareRoot) ValueList
  1109.       CloseRegKey $(Key_SoftwareRoot)
  1110.       ifstr $(KeyList) == "{}"
  1111.          ifstr $(ValueList) == "{}"
  1112.             OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase) $(MAXIMUM_ALLOWED) Key_SoftwareBase
  1113.             Debug-Output "$(STF_CONTEXTINFNAME): Deleting Registry Key .$(Key_SoftwareBase).\.$(Manufacturer)."
  1114.             DeleteRegKey $(Key_SoftwareBase) $(Manufacturer)
  1115.             CloseRegKey $(Key_SoftwareBase)
  1116.          endif
  1117.       endif
  1118.       install Remove-Option
  1119.    endif
  1120.    goto InstallOptionExit
  1121.  
  1122. UpgradeSoftware = +
  1123.    Debug-Output "$(STF_CONTEXTINFNAME): Entering UpgradeSoftware"
  1124.    ifstr(i) $(KeyName_Software) == $(!NTN_RegBase)
  1125.       OpenRegKey $(!REG_H_LOCAL) "" $(KeyName_Software) $(MAXIMUM_ALLOWED) Key_Product
  1126.       Ifstr $(Key_Product) != $(Key_Null)
  1127.          GetRegValue $(Key_Product),"MajorVersion", VersionInfo
  1128.          set Version = *($(VersionInfo), 4)
  1129.          Shell $(UtilityInf), GetInfFileNameFromRegistry, $(Key_Product)
  1130.          ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1131.             set ShellErrorSection = UtilityInf:GetFileNameFromRegistry
  1132.             goto ShellCodeError
  1133.          endif
  1134.          set !UG_Filename = $($R0)
  1135.          ifstr(i) $(!UG_Filename) != ""
  1136.             install "Install-Update"
  1137.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1138.                goto FatalError
  1139.             endif
  1140.          endif
  1141.          SetRegValue $(Key_Product) {MajorVersion, $(NoTitle), $(!REG_VT_SZ), $(SoftwareMajorVersion)}
  1142.          SetRegValue $(Key_Product) {MinorVersion, $(NoTitle), $(!REG_VT_SZ), $(SoftwareMinorVersion)}
  1143.          ifint $(Version) != $(SoftwareVersion)
  1144.             Debug-Output "$(STF_CONTEXTINFNAME): Version .$(Version). != SoftwareVersion .$(SoftwareVersion)."
  1145.          endif
  1146.          CloseRegKey $(Key_Product)
  1147.       else
  1148.          goto FatalRegistryError
  1149.       endif
  1150.    else
  1151.       OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetworkCardKey
  1152.       Ifstr(i) $(NetworkCardKey) != $(Key_Null)
  1153.          GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1154.          set ServiceName = *($(ServiceNameInfo), 4)
  1155.          OpenRegKey $(NetworkCardKey) "" "NetRules" $(MAXIMUM_ALLOWED) NetRuleKey
  1156.          Ifstr(i) $(NetRuleKey) != $(Key_Null)
  1157.             Debug-Output "$(STF_CONTEXTINFNAME): NetRuleKey .$(NetRuleKey). != Key_Null .$(Key_Null)."
  1158.          else
  1159.             goto FatalRegistryError
  1160.          endif
  1161.          CloseRegKey $(NetRules)
  1162.          CloseRegKey $(NetworkCardKey)
  1163.       else
  1164.          goto FatalRegistryError
  1165.       endif
  1166.       OpenRegKey $(!REG_H_LOCAL) +
  1167.                  "" $(!NTN_ServiceBase)"\"$(ServiceName) +
  1168.                  $(MAXIMUM_ALLOWED) +
  1169.                  ServiceKey
  1170.       Ifstr(i) $(ServiceKey) != $(Key_Null)
  1171.          CloseRegKey $(ServiceKey)
  1172.       else
  1173.          goto FatalRegistryError
  1174.       endif
  1175.    endif
  1176.    goto InstallOptionExit
  1177.  
  1178. ProcessSuccessExit = +
  1179.    goto InstallOptionExit
  1180.  
  1181. ProcessAbandonInstall = +
  1182.    ForListDo $(OEM_ABANDON_OPTIONS)
  1183.       Shell $(UtilityInf), +
  1184.             RemoveHardwareComponent, +
  1185.             $(Manufacturer), +
  1186.             $(TccBaseName), +
  1187.             $($)
  1188.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1189.          set ShellErrorSection = UtilityInf:RemoveHardwareComponent
  1190.          goto ShellCodeError
  1191.       endif
  1192.       set RegistryErrorIndex = $($R0)
  1193.       Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1194.          goto FatalRegistryError
  1195.       endif
  1196.    EndForListDo
  1197.    Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1198.       Shell $(UtilityInf), +
  1199.             RemoveSoftwareComponent, +
  1200.             $(Manufacturer), +
  1201.             $(TccBaseName), +
  1202.             FALSE
  1203.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1204.          set ShellErrorSection = UtilityInf:RemoveSoftwareComponent
  1205.          goto ShellCodeError
  1206.       endif
  1207.       set RegistryErrorIndex = $($R0)
  1208.       Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1209.          goto FatalRegistryError
  1210.       endif
  1211.    endif
  1212.    goto InstallOptionExit
  1213.  
  1214. ProcessWarningMessage = +
  1215.    Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1216.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1217.       set ShellErrorSection = SubroutineInf:SetupMessage
  1218.       goto ShellCodeError
  1219.    endif
  1220.    ifstr(i) $($R1) == "OK"
  1221.       goto $(to)
  1222.    else-ifstr(i) $($R1) == "CANCEL"
  1223.       goto $(from)
  1224.    else
  1225.       goto "InstallOptionExit"
  1226.    endif
  1227.  
  1228. SetNonFatalInfo = +
  1229.    Set CommonStatus = STATUS_USERCANCEL
  1230.    Set Severity = STATUS
  1231.    goto ProcessNonFatalMessage
  1232.  
  1233. ProcessNonFatalMessage = +
  1234.    ifstr(i) $(Error) == ""
  1235.       Set Severity = NONFATAL
  1236.       Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1237.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1238.          set ShellErrorSection = UtilityInf:RegistryErrorString
  1239.          goto ShellCodeError
  1240.       endif
  1241.       set Error = $($R0)
  1242.    endif
  1243.    Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1244.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1245.       set ShellErrorSection = SubroutineInf:SetupMessage
  1246.       goto ShellCodeError
  1247.    endif
  1248.    ifstr(i) $($R1) == "OK"
  1249.       goto $(from)
  1250.    else
  1251.       goto "InstallOptionExit"
  1252.    endif
  1253.  
  1254. FatalRegistryError = +
  1255.    Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1256.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1257.       set ShellErrorSection = UtilityInf:RegistryErrorString
  1258.       goto ShellCodeError
  1259.    endif
  1260.    set Error = $($R0)
  1261.    goto FatalError
  1262.  
  1263. FatalError = +
  1264.    ifstr(i) $(Error) == ""
  1265.       Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1266.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1267.          set ShellErrorSection = UtilityInf:RegistryErrorString
  1268.          goto ShellCodeError
  1269.       endif
  1270.       set Error = $($R0)
  1271.    endif
  1272.    Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1273.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1274.       set ShellErrorSection = UtilityInf:SetupMessage
  1275.       goto ShellCodeError
  1276.    endif
  1277.    goto SetFailedStatusAndExit
  1278.  
  1279. ShellCodeError = +
  1280.    Debug-Output $(STF_CONTEXTINFNAME)": Shell error, $(ShellErrorSection)"
  1281.    set DlgType      = "MessageBox"
  1282.    set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1283.    set STF_MB_TEXT  = "Shell Code Error"
  1284.    set STF_MB_TYPE  = 1
  1285.    set STF_MB_ICON  = 3
  1286.    set STF_MB_DEF   = 1
  1287.    ui start "Error Message"
  1288.    goto SetFailedStatusAndExit
  1289.  
  1290. SetFailedStatusAndExit = +
  1291.    set CommonStatus = STATUS_FAILED
  1292.    ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1293.       set OEM_ABANDON_ON = FALSE
  1294.       goto ProcessAbandonInstall
  1295.    endif
  1296.    goto InstallOptionExit
  1297.  
  1298. InstallOptionExit = +
  1299.    Return $(CommonStatus)
  1300.